# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-yapsy
_pkgname=Yapsy
pkgver=1.12.2
pkgrel=1
pkgdesc='Yet another plugin system.'
arch=('any')
url='http://yapsy.sourceforge.net/'
license=('BSD')
depends=('python2')
makedepends=('python2-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('3fdb4de1a6d8f836e22d82354492b99ec9883443c389393d25ea40a08bb0b6ae03db9c947af55237b67764facd4d55a09a36cdba107c8d9202f3700fd55c31fa')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's|bin/python$|&2|' `grep -rl bin/python`
}

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

